﻿using MediatR;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using S.Breed.Domain.Dto;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using S.Breed.Domain;

namespace S.Breed.ApI.Application.Command
{
    public class MaternalMatingCommand
    {
        /// <summary>
        /// 批量添配种信息
        /// </summary>
        public class AddMaternalMatingCommand : IRequest<int>
        {
            /// <summary>
            /// 负责人
            /// </summary>
            public int UserId { get; set; }

            /// <summary>
            /// 事件日期
            /// </summary>
            public DateTime? BreedingDate { get; set; }

            /// <summary>
            /// 单据号
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? DocumentNumber { get; set; }

            /// <summary>
            /// 流水号
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? SerialNumber { get; set; }

            /// <summary>
            /// 备注
            /// </summary>
            [Column(TypeName = "nvarchar(200)")]
            [MaxLength(200)]
            public string? Notes { get; set; }

            public List<MaternalMatings>? MaternalMatings { get; set; }
        }
        public class MaternalMatings
        {
            /// <summary>
            /// 电子耳号
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? EITag { get; set; }
            /// <summary>
            /// 可视耳号
            /// </summary>
            public string EarTag { get; set; }

            /// <summary>
            /// 配种方式
            /// </summary>
            public int? BreedingMethod { get; set; }

            /// <summary>
            /// 种母发情类型
            /// </summary>
            public int? EstrusTypeId { get; set; }

            /// <summary>
            /// 首配评分
            /// </summary>
            [Column(TypeName = "nvarchar(200)")]
            [MaxLength(200)]
            public string? FirstRating { get; set; }

            /// <summary>
            /// 当前栋舍
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? TurnOutBuild { get; set; }

            /// <summary>
            /// 当前栏位
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? TurnOutHuts { get; set; }

            /// <summary>
            /// 转入栋舍
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? TransferBuilding { get; set; }

            /// <summary>
            /// 转入栏位
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? TransferField { get; set; }
            /// <summary>
            /// 创建时间
            /// </summary>
            public DateTime? CreateDate { get; set; }
            /// <summary>
            /// 创建人
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? CreateBy { get; set; }
            /// <summary>
            /// 繁殖状态
            /// </summary>
            public int ReproductiveState { get; set; } = 0;
            /// <summary>
            /// 重量
            /// </summary>
            public decimal? Weight { get; set; }

            /// <summary>
            /// 种母品种
            /// </summary>
            public string? SeedMotherVariety { get; set; }
            /// <summary>
            /// 上次配种日期
            /// </summary>
            public DateTime? lastBreedingDate { get; set; }
            /// <summary>
            /// 种公品种
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? SeedVariety { get; set; }

            /// <summary>
            /// 配种公羊
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? BreedingRam { get; set; }
            /// <summary>
            /// 配种前后状态
            /// </summary>
            public int BreedState { get; set; }
        }

        /// <summary>
        /// 修改状态
        /// </summary>

        public class UpdateStateCommand : IRequest<int> 
        {
            public UpdateStateCommand(string ear)
            {
                Ear = ear;
            }
            public string Ear { get; set; }

        }
        /// <summary>
        /// 修改回状态
        /// </summary>

        public class UpdateHuiStateCommand : IRequest<int>
        {
            public UpdateHuiStateCommand(string ear)
            {
                Ear = ear;
            }
            public string Ear { get; set; }

        }

        /// <summary>
        /// 进行审核
        /// </summary>
        public class UpdExamineCommand : IRequest<bool>
        {
            public UpdExamineCommand(string ids)
            {
                this.Ids = ids;

            }
            public string Ids { get; set; }
        }


        /// <summary>
        /// 修改配种信息
        /// </summary>
        public class UpdMaternalCommand : IRequest<bool> 
        {
            /// <summary>
            /// 负责人
            /// </summary>
            public int UserId { get; set; }

            /// <summary>
            /// 事件日期
            /// </summary>
            public DateTime? BreedingDate { get; set; }

            /// <summary>
            /// 单据号
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? DocumentNumber { get; set; }

            /// <summary>
            /// 流水号
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? SerialNumber { get; set; }

            /// <summary>
            /// 备注
            /// </summary>
            [Column(TypeName = "nvarchar(200)")]
            [MaxLength(200)]
            public string? Notes { get; set; }
            ///主键
            public int BreedId { get; set; }
            /// <summary>
            /// 电子耳号
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? EITag { get; set; }
            /// <summary>
            /// 可视耳号
            /// </summary>
            public string EarTag { get; set; }

            /// <summary>
            /// 配种方式
            /// </summary>
            public int? BreedingMethod { get; set; }

            /// <summary>
            /// 种母发情类型
            /// </summary>
            public int? EstrusTypeId { get; set; }

            /// <summary>
            /// 首配评分
            /// </summary>
            [Column(TypeName = "nvarchar(200)")]
            [MaxLength(200)]
            public string? FirstRating { get; set; }

            /// <summary>
            /// 当前栋舍
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? TurnOutBuild { get; set; }

            /// <summary>
            /// 当前栏位
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? TurnOutHuts { get; set; }

            /// <summary>
            /// 转入栋舍
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? TransferBuilding { get; set; }

            /// <summary>
            /// 转入栏位
            /// </summary>
            [Column(TypeName = "nvarchar(100)")]
            [MaxLength(100)]
            public string? TransferField { get; set; }


            /// <summary>
            /// 种公品种
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? SeedVariety { get; set; }

            /// <summary>
            /// 配种公羊
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? BreedingRam { get; set; }

            /// <summary>
            /// 修改人
            /// </summary>
            [Column(TypeName = "nvarchar(50)")]
            [MaxLength(50)]
            public string? UpdateBy { get; set; }

            /// <summary>
            /// 修改时间
            /// </summary>
            public DateTime? UpdateDate { get; set; }
        }
        /// <summary>
        /// 删除
        /// </summary>
        public class DelMaternalCommand : IRequest<bool> 
        { 
            public DelMaternalCommand(string ids)
            {
                this.ids = ids;
            }
            public string ids { get; set; }
        }

    }

}
